package per.ace.configuration.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import per.ace.configuration.demo.configuration.BoyConfiguration;
import per.ace.configuration.demo.properties.MyPropertiesBean;

/**
 * @program: springbootDemo
 * @description: web
 * @author: ace
 * @Date: 2019-12-29 14:17
 **/
@RestController
@RequestMapping("boy")
public class BoyController {

    @Autowired
    private BoyConfiguration boyConfiguration;
    @Autowired
    private MyPropertiesBean myPropertiesBean;

    @GetMapping
    public void get(){
        System.out.println(boyConfiguration.boyBean().toString());
    }

    @GetMapping("/pro")
    public String getPro(){
        return myPropertiesBean.getName();
    }
}
